#include "fxcc/core/MetaCache.h"
#include "fxcc/yml/Serializer.h"
#include "fxcc/core/graph/common/TextureMetaCacheFile.h"

template<>
void fxcc::yml::Serializer::Encode<TextureMetaCacheFile>(YAML::Node& node, const TextureMetaCacheFile& inst)
{
	SetMapVariableKeyFilter<TextureMetaCache>(node, "m_TextureMetaCaches", inst.m_TextureMetaCaches, [&](const TextureMetaCache& inst) {return true; }, [&](const std::string& key) {return fs::exists(key); });
}


template<>
bool fxcc::yml::Serializer::Decode<TextureMetaCacheFile>(const YAML::Node& node, TextureMetaCacheFile& inst)
{
	GetMapVariable<TextureMetaCache>(node, "m_TextureMetaCaches", inst.m_TextureMetaCaches);

	return true;
}